On the Efficiency of Optimising Shallow Backtracking in Compiled Prolog

نویسنده

  • Mats Carlsson
چکیده

The cost of backtracking has been identified as one of the bottlenecks in achieving peak performance in compiled Prolog programs. Much of the backtracking in Prolog programs is shallow, i.e. is caused by unification failures in the head of a clause when there are more alternatives for the same procedure, and so special treatment of this form of backtracking has been proposed as a significant optimisation. This paper describes a modified WAM which optimises shallow backtracking. Four different implementation approaches are compared. A number of benchmark results are presented, measuring the relative tradeoffs between compilation time, code size, and run time. The results show that the speedup gained by this optimisation can be significant. ______________________________________________________________________________ ____ ‡ The paper also appears in Logic Programming: Proceedings of the Sixth International Conference, MIT Press, pp. 3–16, 1989.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Shallow Backtracking in Prolog Programs

The efficiency of Prolog compilers is increasing rapidly but the Prolog programs still cannot compete with traditional languages when executing simple conditionals. In this paper we present a possibility to increase Prolog performance by exploiting the shallow backtracking. Shallow backtracking is initiated when a call fails to unify with the head of a clause and it backtracks to another clause...

متن کامل

Translating Prolog to C: a WAM-based approach

A translator from Prolog to C (or C++) can be used as a very e ective tool for performing multiparadigm programming. In [4], we have argued in favour of translation-based multi-paradigm programming. We illustrated how C++ and Prolog could be used advantageously together to build a demonstration compiler. We are now directing our e orts to improving the quality of the translation. Many Prolog sy...

متن کامل

Learning While Searching in Constraint-Satisfaction-Problems

The popular use of backtracking as a control strategy for theorem proving in PROLOG and in Truth-MaintenanceSystems (TMS) led to increased interest in various schemes for enhancing the efficiency of backtrack search. Researchers have referred to these enhancement schemes by the names ‘ ‘Intelligent Backtracking’ ’ (in PROLOG), ‘ ‘Dependencydirected-backtracking” (in TMS) and others. Those impro...

متن کامل

Optimal Backtracking based on Failure-bindings in Prolog

This paper describes a method for optimal backtracking Prolog based on failure-bindings of literals. A modified unification algorithm is presented in order to identify all possible causes of failure during execution. Methods to select optimal back-point and the use of Failure Binding Tables at run-time are presented. Forwardand Backwardexecution algorithms are also given. keywords: prolog, inte...

متن کامل

Enhancing a search algorithm to perform intelligent backtracking

This paper illustrates how a Prolog program, using chronological backtracking to find a solution in some search space, can be enhanced to perform intelligent backtracking. The enhancement crucially relies on the impurity of Prolog that allows a program to store information when a dead end is reached. To illustrate the technique, a simple search program is enhanced. To appear in Theory and Pract...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1989